home *** CD-ROM | disk | FTP | other *** search
- Path: news.PBI.net!usenet
- From: mich@pbinet.com
- Newsgroups: comp.lang.c
- Subject: Re: What dose a DLL file do?
- Date: 17 Mar 1996 06:04:04 GMT
- Organization: Pacific Bell Internet Services
- Message-ID: <4iga0k$qpa@SNFC21_SRVR_WWW.PBI.net>
- References: <4h8b73$7ua@coranto.ucs.mun.ca> <4hagaf$9id@dewey.csun.edu>
- Reply-To: mich@pbinet.com
- NNTP-Posting-Host: ppp-5-2.rdcy01.pbinet.com
- X-Newsreader: IBM NewsReader/2 v1.03
-
- In <4hagaf$9id@dewey.csun.edu>, hbmus009@csun.edu (christopher johnson) writes:
- >Matthew Smyth (ybf1037@InfoNET.st-johns.nf.ca) wrote:
- >> I was wondering what exactly dose a DLL file do?
- >
- >DLL stands for Dynamic Link Library. These are a special kind of library
- >that doesn't get statically linked into your programs. The final linking
- >process happens when you execute a program that will make use of a
- >particular DLL. Ok, that didn't make a lot of sense to anyone that
- >doesn't know what a DLL is in the first place. Let me try again.
-
- DLL Fundamentals.
-
- A dll (or shared object in unix) is a collection of routines that is available to any
- program that wants to use it. UNIX, Windows, OS/2, and any intelligent os uses
- shared libraries.
- You can link to such a library either statically or dynamically. There are
- benes and bad points about either method.
- A shared lib is good in any case becuase a well planned one can provide a number
- of functions to a number of execution level programs at minimum memory cost.
- Thats why you use them.
- A good example of a dll is one that provides low level i/o services to a terminal
- emulator. Opening the i/o port, sending a byte OR a block to the port, and closing
- the port are all separate functions that you might find in a dll that comes with
- a term program.
- A better example might be a dll that handles disk i/o. There would be separate
- functions that open a file, position the head, and write a byte or a block, check
- the crc for a block, write permissions, and close the file, and the functions from
- this one object are available to any program that needs to use them.
- If you have a mail reader, the operating system, and say a disk editor loaded in
- memory doing what they do, they are all using one library. Much more efficient
- than them all having thier own routines taking up that much more memory.
- Static linking to such a library is when you include that libraries '.lib' file in your
- project or make file. The entry points for dll (or lib) functions are resolved for you
- at compile time and a map of these points is reserved in part of your executable's
- data space for all time. No muss, no fuss. This is the easy route (as far as the
- programmer is concerned.) They cannot change, they are static.
- Dynamic linking is when the entry points are resolved at runtime, thus they are
- dynamic. You have to do some extra coding. A function must be called that actually
- searches for the entry point in the library, loads it, then a another function must be
- called to execute the exported function in the object, then another function must be
- called to clean up the mess caused by the previous process, which incures a slight
- lag in execution. But the savings in memory is great.
- Functions that are used dynamically have the greatest memory saving. Windows
- (and all the other modern os's) are a collection of dll's.
- Ok, I'll get off my pulpit now.
-
-